<template>
	<view class="" style="height: 50rpx;background: var(--primaryBg);position: relative;">
		<view class="cont-box" :style="{height:`calc(100vh - ${CustomBar+9}px)`}">
			<image src="https://qiyeji.oss-cn-beijing.aliyuncs.com/20250111/202412201442082528.png" mode=""></image>
			<view v-if="!petTeam.applyStatus" class="">
				<view class="">
					您还不是服务商,
				</view>
				<view class="">
					请先申请成为服务商
				</view>
			</view>
			<view v-else-if="petTeam.cargoTeamStatus == 'WAIT'" class="">
				申请中，待相关人员审核
			</view>
			<view v-else-if="petTeam.cargoTeamStatus == 'DENY'" class="">
				审核未通过，请重新申请
			</view>
			<view v-if="petTeam.applyStatus && petTeam.cargoTeamStatus=='DENY'" class="btn" @click="handleReject" style="background: #fff;border: 1rpx solid #ffe459;">
				驳回原因
			</view>
			<view v-if="(!petTeam.applyStatus) || (petTeam.applyStatus && petTeam.cargoTeamStatus=='DENY')" @click="toPage" class="btn">
				立即申请
			</view>
		</view>
		<showModal1 ref="showModal1"></showModal1>
	</view>
</template>

<script>
	import {
		teamDetail
	} from "@/api/team/index.js";
	import showModal1 from "@/components/show-modal1.vue"
	export default{
		props:{
			petTeam:{
				type:Object,
				default:()=>{}
			}
		},
		components:{
			showModal1
		},
		data(){
			return{
				CustomBar:this.CustomBar,
				detail:{},
			}
		},
		methods:{
			handleReject(){
				teamDetail({id:this.petTeam.cargoTeamId}).then(res=>{
					this.detail = res
					this.$refs.showModal1.open({
						title:'驳回原因',
						content:res.remark,
					})
				})
			},
			toPage(){
				uni.navigateTo({
					url:`/pagesPet/pages/merchant/index`
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.cont-box{
		width: 100%;
		background: #fff;
		position: absolute;
		top: 18rpx;
		border-radius: 32rpx 32rpx 0rpx 0rpx;
		display: flex;
		align-items: center;
		flex-direction: column;
		padding-top: 168rpx;
		// justify-content: center;
		image{
			margin-bottom: 24rpx;
			width: 240rpx;
			height: 240rpx;
		}
		view{
			margin-bottom: 8rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 600;
			font-size: 32rpx;
			color: var(--h1Color);
			line-height: 48rpx;
			text-align: center;
			font-style: normal;
		}
		.btn{
			margin-top: 64rpx;
			width: 320rpx;
			height: 96rpx;
			background: var(--primaryGradBg);
			border-radius: 53rpx;
			
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 30rpx;
			color: var(--btnColor);
			line-height: 42rpx;
			text-align: center;
			font-style: normal;
			
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>